package com.np.mvp1;

public class Presenter implements IContract.Presenter, IContract.Model.CallBack {
    private IContract.View mView;
    private IContract.Model mModel;

    public Presenter(IContract.View view, IContract.Model model) {
        this.mView = view;
        this.mModel = model;
    }

    @Override
    public void onButtonClick() {
        if (mView != null) {
            mView.showProgress();
        }
        mModel.getNext(this);
    }

    @Override
    public void onDestroy() {
        mView = null;
    }

    @Override
    public void onGetNextSuccess(String string) {
        if (mView != null) {
            mView.showNote(string);
            mView.hideProgress();
        }
    }
}
